<template>
  <div class="payment">
    支付环境:{{payType}}
  </div>
</template>

<script>
import {ref} from "vue";

export default {
  name: "payment",
  setup(){
    let payType = ref('其他浏览器')
    if (/MicroMessenger/.test(window.navigator.userAgent)) {
      payType.value = '微信'
    } else if (/AlipayClient/.test(window.navigator.userAgent)) {
      payType.value = '支付宝'
    }
    return{payType}
  }
}
</script>

<style lang="scss" scoped>
.payment{
  padding:12px;
}
</style>
